<?php

/**
 * mediaPhoto actions.
 *
 * @package    cpfaizenay
 * @subpackage mediaPhoto
 * @author     Manu
 * @version    1.0
 */
class mediaVideoActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request) {
      $this->albumsVideos = Doctrine::getTable('Category')->getVideosCategories(null, 'published')->fetchArray();
      $this->photos = Doctrine::getTable('sfAssetMedia')->getVideos()->fetchArray();

      isicsBreadcrumbs::getInstance()->addItem('Vidéos', '#');

      $response = $this->getResponse();
      Utils::setSlogTitle("Vidéos du club", $response);
  }

  public function executeShowVideos(sfWebRequest $request) {
      $this->slug_category = $request->getParameter('title_slug');

      $this->videos_list = Doctrine::getTable('sfAssetMedia')->getVideos($this->slug_category)->fetchArray();
      $this->forward404Unless($this->videos_list);
//
      isicsBreadcrumbs::getInstance()->addItem('Videos', '@videos');
      isicsBreadcrumbs::getInstance()->addItem($this->videos_list[0][ 'title' ], '#');

      $response = $this->getResponse();
      Utils::setSlogTitle("Vidéos " . $this->videos_list[0][ 'title' ], $response);
  }

}